introduction to calculus of variations